package com.yzh.openai.types.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商品状态
 */
@Getter
@AllArgsConstructor
public enum ProductEnable {
    CLOSE(0, "无效，已关闭"),
    OPEN(1,"有效，使用中"),
    ;
    private Integer code;
    private String info;

    public static ProductEnable get(Integer code){
        switch (code){
            case 0:
                return CLOSE;
            case 1:
                return OPEN;
            default:
                return CLOSE;
        }
    }
}
